The XML (eXtended Markup Language) typically provides a standard approach of tagging data, wherein data can be read and interpreted by a variety of Web browsers, and employed in WebServices, for example. Given the enormous proliferation of web hosts and applications on global communications networks such as the Internet, XML documents are used extensively in daily transactions.
Document type definition (DTD) is one technology that defines the document structure of an XML document according to a list of legal elements or building blocks. From a DTD perspective, all XML documents (and HTML documents) are made up of simple building blocks, namely: elements, tags (used to markup elements), attributes (used to provide extra information about elements), entities (variables used to define common text), Parsed Character Data (PCDATA), and Character Data (CDATA). In general, elements are the main building blocks of XML documents. Examples of XML elements include; “note” and “message”, and elements can further contain text, other elements, or be empty.
Moreover, the XML Schema is a W3C (World Wide Web Consortium) standard that defines a schema definition language for an XML data model. Schema definitions (e.g., a type definition such as CustomerType that describes structure of information regarding each Customer) can be employed to validate content and structure of XML instance documents. The XML schema document can be expressed differently from table and column definitions of a relational database system. The type information supplied in an XML schema document can also be used to check XML queries for correctness, and optimize XML queries and XML storage.
Also, XML schema provides a more robust replacement to DTD technology. For example, the XML schema is extensible to future additions to allow extending or restricting a type definition; XML schema is richer and more useful than DTD to allow, for example, the capability to define user-defined types; XML schema is written in XML; XML schema supports data types; and XML schema supports namespaces. Unlike DTD, XML schema provides separation between type and element definitions, so that multiple elements (e.g., LocalCustomer and DistantCustomer) of the same type can be defined using a common type definition (e.g., CustomerType). An XML schema document can import other XML schema documents, thereby setting up a type library system.
However, there exists an impedance mismatch between the looseness of the “document world” from which XML evolved, and a more structured world of object oriented programming languages, which dominates the applications world. Bridging such two worlds today is conventionally accomplished by employing specialized objects that model the XML world called “XML Document Object Model,” or by “XML Serialization” technologies, which intelligently map one world into the other at runtime. However, such bridging mechanisms are often cumbersome and/or limited in functionality.
Moreover, for certain styles of organizing XML schemas (e.g., Garden of Eden, and the like) if such styles are not paid attention to (e.g., naïve mapping) unexpected object models can result. For example, inappropriate nesting and an unreasonable number of object types.